package cn.edu.scnu.semart.common.config;

import cn.edu.scnu.semart.common.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
//public class WebConfig implements WebMvcConfigurer {
public class WebConfig {
    @Resource
    private LoginInterceptor loginInterceptor;

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(loginInterceptor)
//                .addPathPatterns("/**")
//                .excludePathPatterns(
//                        "/auth/**",
//                        "/admin/user/save",
//                        // ↓↓↓ 必须加上 ↓↓↓
//                        "/swagger-ui/**",
//                        "/swagger-resources/**",
//                        "/v2/api-docs",
//                        "/webjars/**",
//                        "/doc.html"          // 如果你用 Knife4j
//                );
//    }
}